import Router from 'koa-router';
import { JianceApiController } from "../controller/JianceApiController";

const router = new Router();

router.prefix('/api/jiance');

router
    /**
     * /api/jiance/create
     *  post:
     *      summary: 请求检测api
     *          tags: [商品检测]
     *      consumes:
     *          - application/json
     *      parameters:
     *          - in: body
     *            shop_id: 店铺id
     *            ImgUrl: 图片链接
     *            ItemId: ItemId
     *            NeedCheckLogo: bool类型， 默认true
     *
     */
    .post('/create', JianceApiController.create.bind(JianceApiController))
    /**
     * /api/jiance/batch
     *  post:
     *      summary: 批量请求检测api
     *          tags: [商品检测]
     *      consumes:
     *          - application/json
     *      parameters:
     *          - in: body
     *            shop_id: 店铺id
     *            jianceList[]:
     *              ImgUrl: 图片链接
     *              ItemId: ItemId
     *              NeedCheckLogo: bool类型， 默认true
     *
     */
    .post('/batch', JianceApiController.batch.bind(JianceApiController))
    /**
     * /api/jiance/batchResult
     *  post:
     *      summary: 批量请求检测api结果接口
     *          tags: [商品检测]
     *      consumes:
     *          - application/json
     *      parameters:
     *          - in: body
     *            shop_id: 店铺id
     *            batchId: batchIds
     *
     */
    .post('/batchResult', JianceApiController.batchResult.bind(JianceApiController))
    /**
    * @swagger
    * /api/jiance/history:
    *   get: 
    *     description: 获取用户检测历史记录
    *     tags: [商品检测] 
    *     summary: "获取用户检测历史记录"
    *     parameters:
    *             - in: query
    *               name: phone
    *               description: 手机号
    *               required: true
    *               type: string
    *               default: 13812345678
    *     produces: 
    *       - application/json 
    *     responses: 
    *       200:
    *         description: 获取数据列表 
    * */
    .get('/history', JianceApiController.history)


export default router;